public class ChargedTransaction extends Object implements XMLMarshallable
prepaid account
or to an external account (postpaid account) in a subscriber account.
Note
The SAP CC system can generate different types of transactional data. Refer to the SAP CC Application Help for more information.
TaxStatusThe XML APIs specify the following XSD fragment:
XSD Fragment
<xs:element name="chargedTransaction">
<xs:complexType>
<xs:sequence>
<xs:element ref="taxDetail" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="detail" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="serviceProvider" type="xs:string"/>
<xs:attribute name="subscriberAccountCode" type="xs:string"/>
<xs:attribute name="subscriberAccountReference" type="xs:string"/>
<xs:attribute name="accountCode" type="xs:string"/>
<xs:attribute name="externalAccountCode" type="xs:string"/>
<xs:attribute name="externalAccountName" type="xs:string"/>
<xs:attribute name="accountType">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="prepaid"/>
<xs:enumeration value="external"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="operationType">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="credit"/>
<xs:enumeration value="debit"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="baseAmount" type="xs:string"/>
<xs:attribute name="amount" type="xs:string"/>
<xs:attribute name="date" type="xs:dateTime"/>
<xs:attribute name="creditorId" type="xs:string"/>
<xs:attribute name="debtorId" type="xs:string"/>
<xs:attribute name="taxAmount" type="xs:string"/>
<xs:attribute name="totalAmount" type="xs:string"/>
<xs:attribute name="taxCode" type="xs:string" use="required"/>
<xs:attribute name="taxStatus" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="tsNoTax"/>
<xs:enumeration value="tsForInfo"/>
<xs:enumeration value="tsApplied"/>
<xs:enumeration value="tsTaxExempted"/>
<xs:enumeration value="tsTaxMissedForInfo"/>
<xs:enumeration value="tsTaxMissedForApply"/>
<xs:enumeration value="tsUnknown"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
| Modifier and Type | Class and Description |
|---|---|
static class |
ChargedTransaction.AccountType
This abstract class describes an account type
|
| Modifier and Type | Field and Description |
|---|---|
static OperationType |
CREDIT_OPERATION
CREDIT_OPERATION
|
static OperationType |
DEBIT_OPERATION
DEBIT_OPERATION
|
static ChargedTransaction.AccountType |
EXTERNAL_ACCOUNT
EXTERNAL_ACCOUNT
|
static ChargedTransaction.AccountType |
PREPAID_ACCOUNT
PREPAID_ACCOUNT
|
| Constructor and Description |
|---|
ChargedTransaction()
FOR INTERNAL USE ONLY - Builds an empty charged transaction.
|
ChargedTransaction(com.highdeal.pnr.domain.IAccountAccessor suacModel,
OperationType opType,
String accountCode,
ChargedTransaction.AccountType accountType,
Date date,
Money amount,
boolean isForced)
Initializes a charged transaction.
|
ChargedTransaction(com.highdeal.pnr.domain.IAccountAccessor suacModel,
OperationType opType,
String accountCode,
String externalAccountCode,
String externalAccountName,
ChargedTransaction.AccountType accountType,
Date date,
Money amount,
boolean isForced)
Initializes a charged transaction.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCharacterData(String cData)
Adds character data to the content element.
|
void |
addChild(String tagName,
XMLMarshallable child)
Adds a child to the object, the
child representing
the marshallable object which must be added to the element. |
String |
getAccountCode()
Returns the code of the charged account.
|
ChargedTransaction.AccountType |
getAccountType()
Returns the type of the charged account.
|
Money |
getAmount()
Returns the amount of the charging.
|
Money |
getBaseAmount()
Returns the base amount of the charging.
|
ChargedItem |
getChargedItem()
Returns the charged item associated to this charged transaction.
|
static OperationType |
getCreditOperation() |
String |
getCreditorId()
Returns the creditor identifier of the charged account.
|
Date |
getDate()
Returns the date of the charge.
|
static OperationType |
getDebitOperation() |
String |
getDebtorId()
Returns the debtor identifier of the charged account.
|
DetailRecord |
getDetailRecord()
Returns the detail records of this charged transaction.
|
static ChargedTransaction.AccountType |
getExternalAccount() |
String |
getExternalAccountCode() |
String |
getExternalAccountName() |
OperationType |
getOperationType()
Returns the type of the operation of the this charged transaction: debit or credit.
|
OperationType |
getOpType() |
static ChargedTransaction.AccountType |
getPrepaidAccount() |
String |
getServiceProvider()
Returns the service provider of the subscriber account related of the charge.
|
String |
getSubscriberAccountCode()
Returns the code of the subscriber account related to the charge.
|
String |
getSubscriberAccountReference()
Returns the internal reference of the subscriber account related to the charge.
|
Money |
getTaxAmount()
Returns the tax amount of the charging.
|
String |
getTaxCode()
Returns the tax code of the charging.
|
List<TaxDetailModel> |
getTaxDetails()
Returns a list of
TaxDetailModel. |
TaxStatus |
getTaxStatus()
Returns the tax status of the charging.
|
Money |
getTotalAmount()
Returns the total amount of the charging.
|
boolean |
hasTaxDetails()
Indicates whether the taxed amount has details.
|
boolean |
isExternalAccount()
Indicates whether the account type is External.
|
boolean |
isForced()
Returns if the charge was forced or not.
|
boolean |
isPrepaidAccount()
Indicates whether the account type is Prepaid.
|
void |
marshal(XMLOutputter output)
Gives an XML representation of this object, including its children.
|
void |
negateAmount()
Negates the amount of this charged transaction.
|
void |
setAmount(Money amount)
Sets the amount of the charging.
|
void |
setAttributes(XMLAttributes atts)
Sets the attributes of the XML representation of the element being
processed.
|
void |
setBaseAmount(Money baseAamount)
Sets the base amount of the charging.
|
void |
setChargedItem(ChargedItem chargedItem)
Sets the charged item associated to this charged transaction.
|
void |
setTaxAmount(Money taxAmount)
Sets the tax amount of the charging.
|
void |
setTaxCode(String taxCode)
Sets the tax code of the charging.
|
void |
setTaxStatus(TaxStatus taxStatus)
Sets the tax status of the charging.
|
void |
setTotalAmount(Money totalAmount)
Sets the total amount of the charging.
|
String |
toString()
Returns a string representation of the charged transaction.
|
public static final ChargedTransaction.AccountType PREPAID_ACCOUNT
public static final ChargedTransaction.AccountType EXTERNAL_ACCOUNT
public static final OperationType CREDIT_OPERATION
public static final OperationType DEBIT_OPERATION
public ChargedTransaction()
public ChargedTransaction(com.highdeal.pnr.domain.IAccountAccessor suacModel,
OperationType opType,
String accountCode,
ChargedTransaction.AccountType accountType,
Date date,
Money amount,
boolean isForced)
suacModel - The subscriber account that contains the charged accountopType - The operation type: DEBIT_OPERATION or CREDIT_OPERATIONaccountCode - The identification code of the charged accountaccountType - The type of the charged account: PREPAID_ACCOUNT if the charged account is a prepaid account
or EXTERNAL_ACCOUNT if the charged account is an external accountdate - Date when the charging operation has been doneamount - The amount of the chargeisForced - Flag that must be set to true to force charging on account, even if balance is empty.IllegalArgumentException - if one argument is empty (null or empty string).public ChargedTransaction(com.highdeal.pnr.domain.IAccountAccessor suacModel,
OperationType opType,
String accountCode,
String externalAccountCode,
String externalAccountName,
ChargedTransaction.AccountType accountType,
Date date,
Money amount,
boolean isForced)
suacModel - The subscriber account that contains the charged accountopType - The operation type: DEBIT_OPERATION or CREDIT_OPERATIONaccountCode - The identification code of the charged accountexternalAccountCode - The code of the account in the external billing systemexternalAccountName - The name of the account in the external billing systemaccountType - The type of the charged account: PREPAID_ACCOUNT if the charged account is a prepaid account
or EXTERNAL_ACCOUNT if the charged account is an external accountdate - Date when the charging operation has been doneamount - The amount of the chargeisForced - Flag that must be set to true to force charging on account, even if balance is emptyIllegalArgumentException - if one argument is empty (null or empty string)public final OperationType getOperationType()
DEBIT_OPERATION or CREDIT_OPERATIONpublic final String getAccountCode()
IllegalStateException - if the account code is null (invalid xml initialization)public static ChargedTransaction.AccountType getPrepaidAccount()
public static ChargedTransaction.AccountType getExternalAccount()
public static OperationType getCreditOperation()
public static OperationType getDebitOperation()
public String getExternalAccountCode()
public String getExternalAccountName()
public OperationType getOpType()
public final ChargedTransaction.AccountType getAccountType()
PREPAID_ACCOUNT if the charged account is a prepaid account
or EXTERNAL_ACCOUNT if the charged account is an external accountIllegalStateException - if the account type is null (invalid xml initialization)public final Money getBaseAmount()
public void setBaseAmount(Money baseAamount)
baseAamount - A base amountpublic final Money getAmount()
IllegalStateException - if the amount is null (invalid xml initialization)public void setAmount(Money amount)
amount - An amountpublic final Money getTaxAmount()
public void setTaxAmount(Money taxAmount)
taxAmount - A tax amountpublic final Money getTotalAmount()
public void setTotalAmount(Money totalAmount)
totalAmount - A total amountpublic final String getTaxCode()
public void setTaxCode(String taxCode)
taxCode - A tax codepublic final TaxStatus getTaxStatus()
public void setTaxStatus(TaxStatus taxStatus)
taxStatus - A tax statuspublic final void negateAmount()
public final Date getDate()
IllegalStateException - if the date is null (invalid xml initialization)public final String getServiceProvider()
IllegalStateException - if the service providr is null (invalid xml initialization)public final String getSubscriberAccountCode()
IllegalStateException - if the subscriber account code is null (invalid xml initialization)public final String getSubscriberAccountReference()
IllegalStateException - if the subscriber account internal reference is null (invalid xml initialization)public boolean isForced()
true if the charge was forced, false otherwise.public String getDebtorId()
public String getCreditorId()
public DetailRecord getDetailRecord()
public List<TaxDetailModel> getTaxDetails()
TaxDetailModel.TaxDetailModelpublic boolean hasTaxDetails()
true if the taxed amount has a list of
TaxDetail, else false.public ChargedItem getChargedItem()
public void setChargedItem(ChargedItem chargedItem)
chargedItem - The charged item associated to this charged transactionpublic final boolean isPrepaidAccount()
true if the account type is Prepaid, false otherwise.public final boolean isExternalAccount()
true if the account type is External, false otherwise.public final void setAttributes(XMLAttributes atts)
XMLMarshallablesetAttributes in interface XMLMarshallableatts - The XML attributes of the current elementpublic void addCharacterData(String cData)
XMLMarshallableaddCharacterData in interface XMLMarshallablecData - The character data to be addedpublic final void addChild(String tagName, XMLMarshallable child)
XMLMarshallablechild representing
the marshallable object which must be added to the element.addChild in interface XMLMarshallabletagName - The name of tag for the childchild - The child to be addedpublic final void marshal(XMLOutputter output)
XMLMarshallablemarshal in interface XMLMarshallableoutput - The XML output to marshal the object into